package net.sxnic.ugr.menu.action;

import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import net.sxnic.ugr.dept.Dept;
import net.sxnic.ugr.menu.Menu;

@SuppressWarnings("serial")
public class Left extends MenuAction {
	
	private String root;
	
	private boolean isRoot;

	public String execute() throws Exception {
		
		menu = new Menu();
		menu.setValue("菜单");
		//dept.setTreeLeaf(false);
		Set<Menu> cateSet = new LinkedHashSet<Menu>();
		List<Menu> cates = menuManager.getTopList();
		if(cates!=null && cates.size()>0) {
			for(Menu cate:cates) {
				if(cate!=null)
					cateSet.add(cate);
			}
		}
		menu.setChild(cateSet);

		return SUCCESS;
	}

	public String getRoot() {
		return root;
	}

	public void setRoot(String root) {
		this.root = root;
	}

	public boolean isRoot() {
		return isRoot;
	}

	public void setRoot(boolean isRoot) {
		this.isRoot = isRoot;
	}
}
